import config from "./config";

import axios from "axios";
import qs from "qs";


export function regUser(data){
	return axios.post(`${config.host}/reg`,qs.stringify(data));
}


export function loginUser(data){
	return axios.post(`${config.host}/login`,qs.stringify(data));
}


export function addCollection(data){
	return axios.post(`${config.host}/add/collection`,qs.stringify(data));
}

export function isLike(params){
	return axios.get(`${config.host}/isLike`, {
		params:params
	});
}


export function getCollectlist(id){
	return axios.get(`${config.host}/collectlist/${id}`);
}

export function delCollect(params){
	return axios.get(`${config.host}/del/collection`, {
		params:params
	});
}


export function addAddress(data){
	return axios.post(`${config.host}/add/address`,qs.stringify(data));
}

export function getAddress(userid){
	return axios.get(`${config.host}/address/${userid}`);
}

export function getDefaultAddress(userid){
	return axios.get(`${config.host}/default/address/${userid}`);
}

export function getEditAddress(id){
	return axios.get(`${config.host}/edit/address/${id}`);
}